Strategy

class TaxStrategy
{
public:
	virtual double Calculate() = 0;
	virtual ~TaxStrategy();
}

class CNTax : public TaxStrategy
{
	virtual double Calculate()
	{

	}
}

class USTax : public TaxStrategy
{
	virtual double Calculate()
	{
		
	}
}

//扩展...

class SalesOrder
{
private:
	TaxStrategy* strategy;

public:
	SalesOrder(StrategyFactory* strategyFactory) //工厂类未写出
	{
		this->strategy = strategyFactory -> newStrategy(); //可以返回子类对象的方法
	}
	~SalesOrder()
	{
		delete strategy;
	}

	double val = strategy-> Calculate();
}
